package com.itheima.dubbo.mysql.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.commons.model.domain.UserLoginRecord;
import org.apache.ibatis.annotations.Select;

public interface UserLoginRecordMapper extends BaseMapper<UserLoginRecord> {
    /**
     * 查询用户最近的一次登录记录
     * @param userId
     * @return
     */

    @Select("SELECT * FROM tb_user_login_record where user_id = #{userId} ORDER BY logtime DESC LIMIT 0,1")
    UserLoginRecord queryUserLoginRecordById(Long userId);
}
